using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Mvc.Mailer;
using System.Net.Mail;

namespace PBDesk.com.Mailers
{ 
	public class MyEmails : MailerBase    
	{
		public MyEmails():
			base()
		{
			MasterName="_Layout";
		}

		
		public virtual MailMessage Welcome()
		{
			var mailMessage = new MailMessage{Subject = "Welcome"};
			
			mailMessage.To.Add("pinalbhatt@gmail.com");
			ViewBag.Data = "Tanaya";
			PopulateBody(mailMessage, viewName: "Welcome");

			return mailMessage;
		}

		public virtual MailMessage Welcome(string msg)
		{
			var mailMessage = new MailMessage { Subject = "Welcome" };

			mailMessage.To.Add("pinalbhatt@gmail.com");
			ViewBag.Data = msg;
			PopulateBody(mailMessage, viewName: "Welcome");

			return mailMessage;
		}

		
		public virtual MailMessage AdminTasksNotifications()
		{
			var mailMessage = new MailMessage{Subject = "AdminTasksNotifications"};
			
			//mailMessage.To.Add("some-email@example.com");
			//ViewBag.Data = someObject;
			PopulateBody(mailMessage, viewName: "AdminTasksNotifications");

			return mailMessage;
		}

		public virtual MailMessage AdminTasksNotifications(string subject, string message)
		{
			var mailMessage = new MailMessage { Subject = subject };

			mailMessage.To.Add("pinalbhatt@gmail.com");
			ViewBag.TaskName = subject;
			ViewBag.Message = message;
			PopulateBody(mailMessage, viewName: "AdminTasksNotifications");

			return mailMessage;
		}

		public virtual MailMessage ErrorEmail(string subject, string message)
		{
			var mailMessage = new MailMessage { Subject = subject };
			mailMessage.To.Add("pinalbhatt@gmail.com");
			mailMessage.IsBodyHtml = true;
			ViewBag.TaskName = subject;
			ViewBag.Message = message;
			PopulateBody(mailMessage, viewName: "ErrorEmail");
			return mailMessage;
		}
		
		public virtual MailMessage AdminAlerts()
		{
			var mailMessage = new MailMessage{Subject = "AdminAlerts"};
			
			//mailMessage.To.Add("some-email@example.com");
			//ViewBag.Data = someObject;
			PopulateBody(mailMessage, viewName: "AdminAlerts");

			return mailMessage;
		}

		
	}
}